package com.hzhc.controller.dpData;

import com.hzhc.common.BaseController;
import com.hzhc.entity.DpHarborWork;
import com.hzhc.entity.DpMapData;
import com.hzhc.entity.TrainPlanCity;
import com.hzhc.enumBean.ResultUtilCodeEnum;
import com.hzhc.service.DpHarborWorkService;
import com.hzhc.service.DpMapDataService;
import com.hzhc.service.TrainPlanCityService;
import com.hzhc.utils.ResultUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * <p>
 * 大屏数据
 * </p>
 *
 * @author 功不唐捐
 * @since 2024-09-26
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/dpData")
public class DpMapDataController extends BaseController {
    private final DpHarborWorkService dpHarborWorkService;
    private final DpMapDataService dpMapDataService;
    private final TrainPlanCityService trainPlanCityService;

    /**
     * 大屏 当天作业量
     * @return
     */
    @RequestMapping("/getDpHarborWork")
    public ResultUtil<List<DpHarborWork>> getDpHarborWork(@RequestBody DpHarborWork dpHarborWork){
        List<DpHarborWork> list =dpHarborWorkService.getDpHarborWork(dpHarborWork);
        return ResultUtil.build(list, ResultUtilCodeEnum.SUCCESS);
    }

    /**
     * 大屏 其他数据
     * @return
     */
    @RequestMapping("/getDpMapData")
    public ResultUtil<List<DpMapData>> getDpMapData(@RequestBody DpMapData dpMapData){
        List<DpMapData> list =dpMapDataService.getDpMapData(dpMapData);
        return ResultUtil.build(list, ResultUtilCodeEnum.SUCCESS);
    }

    /**
     * 大屏 航线
     * @return
     */
    @RequestMapping("/getDpLine")
    public ResultUtil<List<TrainPlanCity>> getDpLine(@RequestBody TrainPlanCity trainPlanCity){
        List<TrainPlanCity> list =trainPlanCityService.getDpLine(trainPlanCity);
        return ResultUtil.build(list, ResultUtilCodeEnum.SUCCESS);
    }
}

